<template>
	<!-- 拍品列表 -->
	<view class="home">
		<view class="search">
			<!-- 搜索框 -->
			<!-- 	<u-search placeholder="搜索LOT号或拍品" shape="square" v-model="keyword" @custom="onSearch"
				:actionStyle="{ color: '#3b83f6' }">
			</u-search> -->
		</view>

		<!-- <view class="tabs">
			<view :style="isActive1 == 1 ? 'font-weight:700' : 'font-weight:400'" @click="tabs(1)">
				图录号
				<u-icon style="margin-left: 10rpx" name="arrow-up"></u-icon>
			</view>
			<view :style="isActive1 == 2 ? 'font-weight:700' : 'font-weight:400'" @click="tabs(2)">
				估价
				<u-icon style="margin-left: 10rpx" name="arrow-up"></u-icon>
			</view>
		</view> -->
		<view v-if="infoList.length != 0">
			<AuctionList v-if="dataState" :infoList='infoList'/>
			<view style=" padding:0 20rpx 100rpx 20rpx;" @click="addAuction">
				<u-button type="error" color="#c4c6c9">加载更多</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	import AuctionList from '../../pages/particulars/components/auctionIist.vue';
	export default {
		components: {
			AuctionList
		},
		data() {
			return {
				keyword: "",
				isActive1: 1,
				infoList: [],
				page: 1,
				pageSize: 10,
				dataState: true
			};
		},
		props: {
			particularsId: {
				type: String,
				require: false
			}
		},
		created() {
			this.reqItems(this.page, this.pageSize)
		},
		methods: {
			addAuction() {
				this.reqItems(this.page += 1, this.pageSize)
			},
			async reqItems(page, pageSize) {
				let {
					result
				} = await uniCloud.callFunction({
					name: 'specialDetailsList',
					data: {
						page,
						pageSize,
						auctionId: this.particularsId,
						likeState: 0
					}
				});
				if (page === 1) {
					this.infoList = result.data.data
				} else {
					result.data.data.forEach(item => {
						this.infoList.push(item)
					})
				}
			},
			onSearch() {
				console.log(123);
			},
			tabs(item) {
				console.log(item);
				if (item == 1) {
					this.isActive1 = 1;
				}
				if (item == 2) {
					this.isActive1 = 2;
				}
			},
		},
	};
</script>

<style lang="scss" scoped>
	.home {
		background-color: #fff;
		padding-bottom: 40rpx;

		.search {
			padding: 20rpx 40rpx;
		}

		.tabs {
			display: flex;
			justify-content: space-around;
			padding: 20rpx 40rpx;

			view {
				display: flex;
				align-items: center;
				color: #666;
			}
		}
	}
</style>
